import { createRouter, createWebHashHistory } from 'vue-router';

export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
    // 主页
      path: '/',
      // 路由重定向 重定向到 /home
      // redirect: '/home',
      component: () => import('@/views/home/index.vue'),
      children: [
        {
          // 用户管理
          path: '/user',
          component: () => import('@/views/home/pages/user/index.vue'),
        },
        {
          // 电影管理
          path: '/movie',
          component: () => import('@/views/home/pages/movie/index.vue'),
        },
        {
          // 影院管理
          path: '/cinema',
          component: () => import('@/views/home/pages/cinema/index.vue'),
        },
        {
          // 影厅管理
          path: '/moviehall',
          component: () => import('@/views/home/pages/moviehall/index.vue'),
        },
        {
          // 电影排片
          path: '/plan',
          component: () => import('@/views/home/pages/plan/index.vue'),
        },
        {
          // 电影评价
          path: '/comment',
          component: () => import('@/views/home/pages/comment/index.vue'),
        },
        {
          // 订单管理
          path: '/order',
          component: () => import('@/views/home/pages/order/index.vue'),
        },
      ],
    },
    {
    // 登录
      path: '/login',
      component: () => import('@/views/login/index.vue'),
    },
  ],
});
